package com.deercrowing.takeaway.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import com.deercrowing.takeaway.entity.AddressEntity;

import java.util.List;


/**
 * 地址表(Address)表数据库访问层
 *
 * @author guoyongxiang
 * @since 2024-07-19 09:41:26
 */
@Mapper
public interface AddressMapper extends BaseMapper<AddressEntity> {

    /**
     * 查找用户ID地址信息
     *
     * @param id
     * @return
     */
    List<AddressEntity> selectListByUserId(Long id);

    /**
     * 统计当前用户地址数量
     *
     * @param id
     * @return
     */
    Integer countUserId(Long id);

    AddressEntity selectDefaultAddressByUserId(Long id);
}

